public class Task {
	private String name;
	private boolean completed;

	public Task(String name) {
		this.name = name;
	}

	public void execute() {
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
		}
		System.out.println(name + " >> execute()");
		completed = true;
	}

	public void undo() {
		if (completed) {
			return;
		}
		System.out.println(name + " >> undo()");
	}
}
